(define (display-symbol form) (display form))

(define (display-char ch) (display ch))
(define (display-chars ch) (for-each display-char ch))

(define (display-boolean form)
  (if form
      (display-chars '(#\# #\t))
      (display-chars '(#\# #\f))))

(define (display-int form) (display form))


(define (my-display form)
  (cond ((symbol? form) (display-symbol form))
        ((char? form) (display-char form))
        ((boolean? form) (display-boolean form))
        ((number? form) (display-int form))
        ((null? form) (display-chars '(#\( #\))))
        ((pair? form)
	 (display-char #\()
	 (let loop ((form form))
	   (my-display (car form))
	   (cond ((null? (cdr form))
		  (display-char #\)))
		 ((pair? (cdr form))
		  (display-char #\space)
		  (loop (cdr form)))
		 (else (display-chars '(#\space #\. #\space))
		       (my-display (cdr form))
		       (display-char #\))))))))
